<template>
  <div class="test">
    <!-- 第五 -->
    <h3>实验数据记录与处理</h3>
    <p>
      1.用示波器时基扫描功能测量信号的时间/频率参数
      将校准信号线分别接入到两个通道，使用示波器自带方波信号校准示波器两个测量通道，校准后把时基分度旋钮打在0.2ms/DIV,
      幅度分度旋钮打在0.5V/DIV
    </p>
    <p style="display: inline">表1：测量示波器自带校准方波信号的周期/频率</p>
    <p style="display: inline; font-size: 15px; color: skyblue">
      （每空2分共14分）
    </p>
    <!-- 1. 表1：测量示波器自带校准方波信号的周期/频率（每空2分共14分） -->
    <hot-table
      :settings="shiboSettingsOne"
      :rowHeaders="true"
      :colHeaders="true"
    >
    </hot-table>
    <p>注意：大格数、周期、频率三者的记录均需保留一位小数</p>
    <p>
      选择信号发生器的正弦波接示波器CH2，信号发生器默认幅度2Vp-p，选择不同的时基分度和输入信号频率，测量各信号的周期；此时CH2的幅度分度仍然为0.5V/DIV
    </p>
    <p style="display: inline">表2： 测量正弦波信号周期和频率</p>
    <p style="display: inline; font-size: 15px; color: skyblue">
      （每空2分共24分）
    </p>
    <hot-table
      :settings="shiboSettingsTwo"
      :rowHeaders="true"
      :colHeaders="true"
    >
    </hot-table>
    <p>注意：大格数、周期、频率三者的记录均需保留一位小数</p>
    <p style="display: inline">
      2. 观察李萨如图形并测量频率<br />
      &nbsp; &nbsp;
      &nbsp;按实验步骤接好连线，调节信号发生器（示波器CH2（Y）通道输入）的信号频率fy，显示通道打到CH2,触发器通道默认为CH1，显示方式打开X-Y控制键，观察示波器对应李萨如图形。按如下要求将数据填入下表。
    </p>
    <p style="display: inline; font-size: 15px; color: skyblue">
      （每空5分共30分）
    </p>
    <!-- 表3：观察李萨如图形并测量频率 -->
    <div class="shiboSettingsThreestyle">
      <hot-table
        :settings="shiboSettingsThree"
        :rowHeaders="true"
        :colHeaders="true"
      >
      </hot-table>
      <hot-table
        :settings="shiboSettingsFour"
        :rowHeaders="true"
        :colHeaders="true"
      >
      </hot-table>
    </div>
    <p>
      注：1，此时CH1/CH2的幅度分度均为0.2V/DIV，信号发生器默认幅度2Vp-p
      <br />&nbsp; &nbsp;
      &nbsp;&nbsp;&nbsp;2，此时示波器时基分度为0.2ms/DIV（即使改变此值对李萨如图形测量也影响不大）
    </p>
    <!-- 选择题 -->
    <!-- <p style="display: inline">选择题</p> -->
    <div>
      <h3 style="display: inline">选择题</h3>
      <p style="display: inline; font-size: 15px; color: skyblue">
        （每选项2分，共20分）
      </p>
    </div>
    <br />
    <div>
      <p>1.请根据示波器面板的使用要求，选择正确的选项</p>
      <p>
        A.辉度按钮；B.聚焦按钮；C.水平位移；D.垂直移位；E.扫描微调旋钮；F.触发电平旋钮
      </p>
      <div class="count4">
        <div style="width: 320px">（1）当显示波形线条太粗了，可以尝试使用</div>
        <el-input
          @input="form2.e1 = form2.e1.replace(/[^A-F]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          v-model="form2.e1"
          style="width: 20%"
        ></el-input>
        <p>使波形线条调整至适合宽度。</p>
      </div>
      <div class="count4">
        <div style="width: 320px; line-height: 25px">
          （2）在示波器测量1KHz方波校准信号时，读数不够1KHz，可以尝试
        </div>
        <el-input
          @input="form2.e2 = form2.e2.replace(/[^A-F]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          v-model="form2.e2"
          style="width: 20%"
        ></el-input>
        <div>校准</div>
      </div>
      <div class="count4">
        <p style="width: 320px; line-height: 25px">
          （3）当波形不够稳定不断跳跃时，可以尝试使用
        </p>
        <el-input
          @input="form2.e3 = form2.e3.replace(/[^A-F]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          v-model="form2.e3"
          style="width: 20%"
        ></el-input>
        <p>使波形相对静止</p>
      </div>
      <div class="count4">
        <div style="width: 320px; line-height: 25px">
          （4）在示波器显示波形不够亮时，可以尝试使用
        </div>
        <el-input
          @input="form2.e4 = form2.e4.replace(/[^A-F]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          v-model="form2.e4"
          style="width: 20%"
        ></el-input>
        <p>提高显示波形的亮度</p>
      </div>
    </div>
    <div>
      <div class="count4">
        <p>2.利用示波器测量信号频率的优点是</p>
        <el-input
          v-model="form2.f1"
          @input="form2.f1 = form2.f1.replace(/[^A-D]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          style="width: 16%"
        ></el-input>
        <p>，但不足的是示波器内部时基</p>
      </div>
      <div class="count4">
        <el-input
          v-model="form2.f2"
          @input="form2.f2 = form2.f2.replace(/[^A-D]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          style="width: 16%"
        ></el-input>
        <p>，且</p>
        <el-input
          v-model="form2.f3"
          @input="form2.f3 = form2.f3.replace(/[^A-D]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          style="width: 16%"
        ></el-input>
      </div>
      <div>
        <div>A.精度不高</div>
        <br />
        <div>B.示波器不能测量频率</div>
        <br />
        <div>C.不能直接读数频率，使用周期读数换算到频率会引入误差</div>
        <br />
        <div>D.可以直观的观察出波形</div>
      </div>
    </div>
    <div>
      <div class="count4">
        <p>3.使用李萨如图形测量信号频率实验过程中,信号波形选用</p>
        <el-input
          v-model="form2.g1"
          @input="form2.g1 = form2.g1.replace(/[^A-F]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          style="width: 16%"
        ></el-input>
      </div>
      <div class="count4">
        <p>波形;得到闭合稳定的图案时，两个信号的频率比是</p>
        <el-input
          v-model="form2.g2"
          @input="form2.g2 = form2.g2.replace(/[^A-F]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          style="width: 16%"
        ></el-input>
      </div>
      <div class="count4">
        <p>;在两个信号的相位关系变化时,李萨如图形会发生</p>
        <el-input
          v-model="form2.g3"
          @input="form2.g3 = form2.g3.replace(/[^A-F]/g, '')"
          maxlength="1"
          placeholder="请填写大写字母"
          style="width: 16%"
        ></el-input>
      </div>
      <div>
        <div>A.三角波 B.正弦波 C.方波</div>
        <br />
        <div>D.整数比 E.无理数之比</div>
        <br />
        <div>F.跳出示波器窗口 G.旋转</div>
      </div>
    </div>
    <br />
    <!-- 判断题 -->
    <h3 style="display: inline">判断题</h3>
    <!-- <p style="display: inline">判断题</p> -->
    <p style="display: inline; font-size: 15px; color: skyblue">
      （每题4分，共12分）
    </p>
    <div>
      <p>
        1.在使用示波器的校准信号线校准示波器测量通道时，当示波器屏幕幅度读数不是5V时，可以通过调整“扫描微调旋钮”修正校准相应通道的读数。
      </p>
      <el-radio-group v-model="form2.x1">
        <el-radio label="1">对</el-radio>
        <el-radio label="0">错</el-radio>
      </el-radio-group>
    </div>
    <div>
      <p>2.只有正弦波信号才能利用本实验项目的李萨如图形方法测量频率。</p>
      <el-radio-group v-model="form2.x2">
        <el-radio label="1">对</el-radio>
        <el-radio label="0">错</el-radio>
      </el-radio-group>
    </div>
    <div>
      <p>
        3.在利用李萨如图形测量频率过程中，将示波器时基分度由默认的0.2ms/DIV改为0.1ms/DIV，则李萨如图形的纵横切点数之比会发生变化。
      </p>
      <el-radio-group v-model="form2.x3">
        <el-radio label="1">对</el-radio>
        <el-radio label="0">错</el-radio>
      </el-radio-group>
    </div>
    <h4>线上资源</h4>
    <p class="addmargin">
      1）在线实验报告系统链接：
      <a style="text-decoration: none" href="http://180.76.111.200:3001/"
        >http://180.76.111.200:3001/</a
      >
    </p>
    <div>
      <el-button class="btn" plain type="primary" @click="storage()"
        >暂存</el-button
      >
      <el-button class="btn" type="primary" @click="send('form2')"
        >提交</el-button
      >
    </div>
    <!-- 暂存按钮的弹窗 -->
    <el-dialog title="提示" :visible.sync="DialogVisible" width="30%" center>
      <el-divider></el-divider>
      <div style="text-align: center">请 您 确 定 您 是 否 要 暂 存 ？</div>
      <el-divider></el-divider>
      <span slot="footer" class="dialog-footer">
        <el-button plain @click="DialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="(DialogVisible = false), storageOk()"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { HotTable } from "@handsontable/vue";
import { registerAllModules } from "handsontable/registry";
import "handsontable/dist/handsontable.full.css";

registerAllModules();

export default {
  components: {
    HotTable,
  },
  data() {
    var valiNumberPass1 = (rule, value, callback) => {
      //包含小数的数字
      let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
      if (value === "") {
        callback(new Error("请输入内容"));
      } else if (!reg.test(value)) {
        callback(new Error("请输入数字"));
      } else {
        callback();
      }
    };
    return {
      // 表1 测量示波器自带校准方波信号的周期/频率
      shiboSettingsOne: {
        preventOverflow: "vertical", // 防止水平溢出表
        headerTooltips: true, // header 内容过长提示
        // 数据部分
        data: [
          // 定义行，一共有4行
          {
            conent: "校准信号频率(HZ)",
          },
          {
            conent: "大格数(厘米数)",
          },
          {
            conent: "周期(ms)",
          },
          {
            conent: "频率(Hz)",
          },
        ],
        //最大列
        maxCols: 3,
        //最大行
        maxRows: 4,
        autoColumnSize: true, // 自适应列大小
        rowHeights: 30,
        // customBorders:[],//添加边框
        // 合并的列
        mergeCells: [{ row: 0, col: 1, rowspan: 1, colspan: 2 }],
        // rowHeaders: ['比例臂','电阻臂R0(Ω)','待测电阻值RX(Ω)'],
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            // cellProperties.editor = false;
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 3 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        // 设置列
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 200,
          },
          // 第二列
          {
            width: 210,
            // type: "numeric"
          },
          // 第三列
          {
            width: 210,
            // type: "numeric"
          },
        ],
        // colHeaders: false,
        // 设置表头 + 表头合并
        nestedHeaders: [
          //第一行
          [
            {
              label: "通道",
            },
            {
              label: "CH1",
            },
            {
              label: "CH2",
            },
          ],
        ],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
        // 更新设置，暂存显示
        afterUpdateSettings() {
          const b1 = window.localStorage.getItem("b1");
          if (b1 !== "null") {
            this.setDataAtCell(0, 1, b1);
          }
          const b2 = window.localStorage.getItem("b2");
          if (b2 !== "null") {
            this.setDataAtCell(1, 1, b2);
          }
          const b3 = window.localStorage.getItem("b3");
          if (b3 !== "null") {
            this.setDataAtCell(2, 1, b3);
          }
          const b4 = window.localStorage.getItem("b4");
          if (b4 !== "null") {
            this.setDataAtCell(3, 1, b4);
          }
          const b5 = window.localStorage.getItem("b5");
          if (b5 !== "null") {
            this.setDataAtCell(1, 2, b5);
          }
          const b6 = window.localStorage.getItem("b6");
          if (b6 !== "null") {
            this.setDataAtCell(2, 2, b6);
          }
          const b7 = window.localStorage.getItem("b7");
          if (b7 !== "null") {
            this.setDataAtCell(3, 2, b7);
          }
        },
        //数据改变时触发此方法
        afterChange: function (changes, source) {
          const b1 = this.getData()[0][1];
          sessionStorage.setItem("b1", b1);
          const b2 = this.getData()[1][1];
          sessionStorage.setItem("b2", b2);
          const b3 = this.getData()[2][1];
          sessionStorage.setItem("b3", b3);
          const b4 = this.getData()[3][1];
          sessionStorage.setItem("b4", b4);
          const b5 = this.getData()[1][2];
          sessionStorage.setItem("b5", b5);
          const b6 = this.getData()[2][2];
          sessionStorage.setItem("b6", b6);
          const b7 = this.getData()[3][2];
          sessionStorage.setItem("b7", b7);
        },
      },
      // 表2 测量正弦波信号周期和频率
      shiboSettingsTwo: {
        preventOverflow: "vertical", // 防止水平溢出表
        headerTooltips: true, // header 内容过长提示
        // 数据部分
        data: [
          // 定义行，一共有4行
          {
            conent: "时基分度(ms/DIV)",
            number1: "0.5",
            number2: "0.2",
            number3: "0.1",
          },
          {
            conent: "信号发生器指定频率(Hz)",
            number1: "500",
            number2: "1000",
            number3: "2000",
          },
          {
            conent: "信号发生器实际输出(Hz)",
          },
          {
            conent: "大格数",
          },
          {
            conent: "周期(ms)",
          },
          {
            conent: "频率(Hz)",
          },
        ],
        //最大列
        maxCols: 4,
        //最大行
        maxRows: 6,
        autoColumnSize: true, // 自适应列大小
        rowHeights: 30,
        // customBorders:[],//添加边框
        // 是否展示行表头,默认是1,2,3等数据,可以['行1','行2']进行自定义展示
        // rowHeaders: ['比例臂','电阻臂R0(Ω)','待测电阻值RX(Ω)'],
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            // cellProperties.editor = false;
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 3 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 4 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 5 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        // 设置列
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 150,
          },
          // 第二列
          {
            data: "number1",
            width: 140,
            // type: "numeric",
            // 设置显示格式
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第三列
          {
            data: "number2",
            width: 140,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第四列
          {
            data: "number3",
            width: 140,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
        ],
        // colHeaders: false,
        // 设置表头 + 表头合并
        nestedHeaders: [
          [
            {
              label: "表2： 测量正弦波信号周期和频率",
              colspan: 4,
            },
          ],
        ],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
        // 更新设置，暂存显示
        afterUpdateSettings() {
          const c1 = window.localStorage.getItem("c1");
          if (c1 !== "null") {
            this.setDataAtCell(2, 1, c1);
          }
          const c2 = window.localStorage.getItem("c2");
          if (c2 !== "null") {
            this.setDataAtCell(3, 1, c2);
          }
          const c3 = window.localStorage.getItem("c3");
          if (c3 !== "null") {
            this.setDataAtCell(4, 1, c3);
          }
          const c4 = window.localStorage.getItem("c4");
          if (c4 !== "null") {
            this.setDataAtCell(5, 1, c4);
          }
          const c5 = window.localStorage.getItem("c5");
          if (c5 !== "null") {
            this.setDataAtCell(2, 2, c5);
          }
          const c6 = window.localStorage.getItem("c6");
          if (c6 !== "null") {
            this.setDataAtCell(3, 2, c6);
          }
          const c7 = window.localStorage.getItem("c7");
          if (c7 !== "null") {
            this.setDataAtCell(4, 2, c7);
          }
          const c8 = window.localStorage.getItem("c8");
          if (c8 !== "null") {
            this.setDataAtCell(5, 2, c8);
          }
          const c9 = window.localStorage.getItem("c9");
          if (c9 !== "null") {
            this.setDataAtCell(2, 3, c9);
          }
          const c10 = window.localStorage.getItem("c10");
          if (c10 !== "null") {
            this.setDataAtCell(3, 3, c10);
          }
          const c11 = window.localStorage.getItem("c11");
          if (c11 !== "null") {
            this.setDataAtCell(4, 3, c11);
          }
          const c12 = window.localStorage.getItem("c12");
          if (c12 !== "null") {
            this.setDataAtCell(5, 3, c12);
          }
        },
        //数据改变时触发此方法
        afterChange: function (changes, source) {
          const c1 = this.getData()[2][1];
          sessionStorage.setItem("c1", c1);
          const c2 = this.getData()[3][1];
          sessionStorage.setItem("c2", c2);
          const c3 = this.getData()[4][1];
          sessionStorage.setItem("c3", c3);
          const c4 = this.getData()[5][1];
          sessionStorage.setItem("c4", c4);
          const c5 = this.getData()[2][2];
          sessionStorage.setItem("c5", c5);
          const c6 = this.getData()[3][2];
          sessionStorage.setItem("c6", c6);
          const c7 = this.getData()[4][2];
          sessionStorage.setItem("c7", c7);
          const c8 = this.getData()[5][2];
          sessionStorage.setItem("c8", c8);
          const c9 = this.getData()[2][3];
          sessionStorage.setItem("c9", c9);
          const c10 = this.getData()[3][3];
          sessionStorage.setItem("c10", c10);
          const c11 = this.getData()[4][3];
          sessionStorage.setItem("c11", c11);
          const c12 = this.getData()[5][3];
          sessionStorage.setItem("c12", c12);
        },
      },
      // // 表3 观察李萨如图形并测量频率
      shiboSettingsThree: {
        preventOverflow: "vertical", // 防止水平溢出表
        headerTooltips: true, // header 内容过长提示
        // 数据部分
        data: [
          // 定义行，一共有4行
          {
            conent: "表3：观察李萨如图形并测量频率",
          },
          {
            conent: "fy / fx",
            number1:
              "https://liuru1.oss-cn-chengdu.aliyuncs.com/img/lQLPJxbil8kuDZUYzMCwj2xGmTO20NoDdFDuWsAFAA_192_24.png_720x720q90g.jpg",
            number2:
              "https://liuru1.oss-cn-chengdu.aliyuncs.com/img/lQLPJxbil9NQDKoWzMGwWLiSGZLz2BQDdFD-98CqAA_193_22.png_720x720q90g.jpg",
            number3:
              "https://liuru1.oss-cn-chengdu.aliyuncs.com/img/lQLPJxbil9xA2J4WzL-w0w4REE5Em2MDdFENLECqAA_191_22.png_720x720q90g.jpg",
          },
          {
            conent: "	李萨如图形样例",
            number1:
              "https://isekko-1306311182.cos.ap-nanjing.myqcloud.com/art/aFRC0kHOiiF2L0BtmBM0dFdaNuzYj3Kg2KX0q9Yx.png",
            number2:
              "https://isekko-1306311182.cos.ap-nanjing.myqcloud.com/art/MU7AJhSSH5lgcigOqEOUgdWazhupkiw8RyiKtUDi.png",
            number3:
              "https://isekko-1306311182.cos.ap-nanjing.myqcloud.com/art/QWNB34RQhZDHZ0dy2gT95WVX57xNUOMuP2RLY54h.png",
          },
        ],
        //最大列
        maxCols: 4,
        //最大行
        maxRows: 3,
        autoColumnSize: true, // 自适应列大小
        rowHeights: 30,
        // customBorders:[],//添加边框
        // 是否展示行表头,默认是1,2,3等数据,可以['行1','行2']进行自定义展示
        // rowHeaders: ['比例臂','电阻臂R0(Ω)','待测电阻值RX(Ω)'],
        mergeCells: [{ row: 0, col: 0, rowspan: 1, colspan: 4 }],
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            // cellProperties.editor = false;
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        // 设置列
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 100,
          },
          // 第二列
          {
            data: "number1",
            width: 200,
            renderer(instance, td, row, col, prop, value) {
              const img = document.createElement("img");
              img.src = value;
              img.addEventListener("mousedown", (event) => {
                event.preventDefault();
              });
              td.innerText = "";
              td.appendChild(img);
              return td;
            },
            // 设置显示格式
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第三列
          {
            data: "number2",
            width: 200,
            renderer(instance, td, row, col, prop, value) {
              const img = document.createElement("img");
              img.src = value;
              img.addEventListener("mousedown", (event) => {
                event.preventDefault();
              });
              td.innerText = "";
              td.appendChild(img);
              return td;
            },
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第四列
          {
            data: "number3",
            width: 200,
            renderer(instance, td, row, col, prop, value) {
              const img = document.createElement("img");
              img.src = value;
              img.addEventListener("mousedown", (event) => {
                event.preventDefault();
              });
              td.innerText = "";
              td.appendChild(img);
              return td;
            },
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
        ],
        // colHeaders: false,
        // 设置表头 + 表头合并
        nestedHeaders: [],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
      },
      // 表3 观察李萨如图形并测量频率 续
      shiboSettingsFour: {
        preventOverflow: "vertical", // 防止水平溢出表
        headerTooltips: true, // header 内容过长提示
        rowHeaders: false,
        // 数据部分
        data: [
          // 定义行，一共有4行
          {
            conent: "fy(Hz)",
          },
          {
            conent: "fx(Hz)",
          },
        ],
        //最大列
        maxCols: 4,
        //最大行
        maxRows: 2,
        autoColumnSize: true, // 自适应列大小
        rowHeights: 30,
        // customBorders:[],//添加边框
        // 是否展示行表头,默认是1,2,3等数据,可以['行1','行2']进行自定义展示
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        colHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 100,
          },
          // 第二列
          {
            data: "number1",
            width: 200,
            // type: "numeric"
          },
          // 第三列
          {
            data: "number2",
            width: 200,
            // type: "numeric"
          },
          // 第四列
          {
            data: "number3",
            width: 200,
            // type: "numeric"
          },
        ],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
        afterUpdateSettings() {
          const d1 = window.localStorage.getItem("d1");
          if (d1 !== "null") {
            this.setDataAtCell(0, 1, d1);
          }
          const d2 = window.localStorage.getItem("d2");
          if (d2 !== "null") {
            this.setDataAtCell(1, 1, d2);
          }
          const d3 = window.localStorage.getItem("d3");
          if (d3 !== "null") {
            this.setDataAtCell(0, 2, d3);
          }
          const d4 = window.localStorage.getItem("d4");
          if (d4 !== "null") {
            this.setDataAtCell(1, 2, d4);
          }
          const d5 = window.localStorage.getItem("d5");
          if (d5 !== "null") {
            this.setDataAtCell(0, 3, d5);
          }
          const d6 = window.localStorage.getItem("d6");
          if (d6 !== "null") {
            this.setDataAtCell(1, 3, d6);
          }
        },
        //数据改变时触发此方法
        afterChange: function (changes, source) {
          const d1 = this.getData()[0][1];
          sessionStorage.setItem("d1", d1);
          const d2 = this.getData()[1][1];
          sessionStorage.setItem("d2", d2);
          const d3 = this.getData()[0][2];
          sessionStorage.setItem("d3", d3);
          const d4 = this.getData()[1][2];
          sessionStorage.setItem("d4", d4);
          const d5 = this.getData()[0][3];
          sessionStorage.setItem("d5", d5);
          const d6 = this.getData()[1][3];
          sessionStorage.setItem("d6", d6);
        },
      },
      form2: {
        // student_id: "",
        b1: "",
        b2: "",
        b3: "",
        b4: "",
        b5: "",
        b6: "",
        b7: "",
        c1: "",
        c2: "",
        c3: "",
        c4: "",
        c5: "",
        c6: "",
        c7: "",
        c8: "",
        c9: "",
        c10: "",
        c11: "",
        c12: "",
        d1: "",
        d2: "",
        d3: "",
        d4: "",
        d5: "",
        d6: "",
        e1: "",
        e2: "",
        e3: "",
        e4: "",
        f1: "",
        f2: "",
        f3: "",
        g3: "",
        g2: "",
        g1: "",
        x1: "",
        x2: "",
        x3: "",
      },
      form: {},
      // 删除
      // 渲染表头
      tableData: [
        {
          tongdao: "通道",
          ch1: "CH1",
          ch2: "CH2",
        },
        {
          tongdao: "校准信号频率(HZ)",
          ch1: "1",
          //  ch2:"1"
        },
        {
          tongdao: "大格数(厘米数)",
          ch1: "2",
          ch2: "2",
        },
        {
          tongdao: "周期(ms)",
          ch1: "3",
          ch2: "3",
        },
        {
          tongdao: "频率(Hz)",
          ch1: "4",
          ch2: "4",
        },
      ],
      // 渲染表头
      // tableData1: [
      //   {
      //     hang1: "时基分度(ms/DIV)",
      //     hang2: "0.5",
      //     hang3: "0.2",
      //     hang4: "0.1",
      //   },
      //   {
      //     hang1: "信号发生器指定频率(Hz)",
      //     hang2: "500",
      //     hang3: "1000",
      //     hang4: "2000",
      //   },
      //   {
      //     hang1: "信号发生器实际输出(Hz)",
      //     hang2: "1",
      //     hang3: "1",
      //     hang4: "1",
      //   },
      //   {
      //     hang1: "大格数",
      //     hang2: "2",
      //     hang3: "2",
      //     hang4: "2",
      //   },
      //   {
      //     hang1: "周期(ms)",
      //     hang2: "3",
      //     hang3: "3",
      //     hang4: "3",
      //   },
      //   {
      //     hang1: "频率(Hz)",
      //     hang2: "4",
      //     hang3: "4",
      //     hang4: "4",
      //   },
      // ],
      // 渲染表头
      // tableData2: [
      //   {
      //     h1: "fy / fx",
      //     h2: "2/1",
      //     h3: "1/1",
      //     h4: "1/2",
      //   },
      //   {
      //     h1: "李萨如图形样例",
      //     h2: "1",
      //     h3: "1",
      //     h4: "1",
      //   },
      //   {
      //     h1: "fy(Hz)",
      //     h2: "2",
      //     h3: "2",
      //     h4: "2",
      //   },
      //   {
      //     h1: "fx(Hz)",
      //     h2: "3",
      //     h3: "3",
      //     h4: "3",
      //   },
      // ],
      // 暂存弹窗
      DialogVisible: false,
    };
  },
  created() {
    // this.form2.student_id = window.sessionStorage.getItem("student_id");
    // console.log(this.form2.student_id);
    // 暂存
    this.storageCheck();
    localStorage.setItem("state3", 1);
  },
  // 暂存
  //1 首先进入页面的时候需要监听浏览器的后退按钮，之后在操作的时候执行函数,在mounted中挂载去监听这个事件，并在methods里面添加函数，用来判断执行的条件
  mounted() {
    if (window.history && window.history.pushState) {
      history.pushState(null, null, document.URL);
      window.addEventListener("popstate", this.back, false);
    }
  },
  // 暂存
  // 2：需要在退出页面的时候销毁这个监听事件
  // 注意必须要销毁this.back这个方法，不然会将this.back方法执行两遍
  destroyed() {
    window.removeEventListener("popstate", this.back, false);
  },
  methods: {
    // 删除
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 1) {
        if (columnIndex === 1) {
          return [1, 2];
        }
      }
    },
    // 提交 + 接口按钮方法
    async send() {
      for (var key in this.form2) {
        if (this.form2[key] == "null") {
          this.$message.error("题目未做完！");
          return false;
        }
      }
      for (var key in this.form2) {
        if (!this.form2[key]) {
          this.$message.error("题目未做完！");
          return false;
        }
      }
      // console.log(this.form2.student_id);
      const answer1 = (
        this.form2.e1 +
        this.form2.e2 +
        this.form2.e3 +
        this.form2.e4 +
        this.form2.f1 +
        this.form2.f2 +
        this.form2.f3 +
        this.form2.g1 +
        this.form2.g2 +
        this.form2.g3
      ).split("");
      const answer2 = ["B", "E", "F", "A", "D", "A", "C", "B", "D", "G"];
      var mark1 = 0;
      for (let i = 0; i < answer1.length; i++) {
        if (answer1[i] == answer2[i]) {
          mark1 = mark1 + 2;
        }
      }
      const answer3 = (this.form2.x1 + this.form2.x2 + this.form2.x3).split("");
      const answer4 = ["0", "1", "0"];
      var mark2 = 0;
      for (let i = 0; i < answer3.length; i++) {
        if (answer3[i] == answer4[i]) {
          mark2 = mark2 + 4;
        }
      }
      var mark = 0;
      mark = mark1 + mark2;
      // 111?
      this.form2.student_id = window.sessionStorage.getItem("student_id");
      const { data: res } = await this.$http.post(
        "/api/shiboqi/luru",
        this.form2
      );
      if (res.data.res1 == false) {
        this.$message.error("请勿重复提交！");
        this.$router.push("/home");
      } else {
        if (res.code == 100) {
          this.$message.error("提交失败！");
        }
        if (res.code == 150) {
          this.$message.error("请勿重复提交！");
        }
        if (res.code == 422) {
          this.$message.error("请填完所有题目");
        }
        if (res.code == 200) {
          this.$message.success("提交成功！");
          window.localStorage.clear();
          this.$router.push("/home");
        }
      }
    },
    // 暂存
    back() {
      const state3 = localStorage.getItem("state3");
      // console.log(state3);
      if (state3 == 1) {
        this.$confirm(
          "检测到未保存的内容，是否在离开页面前保存？",
          "确认信息",
          {
            confirmButtonText: "暂存",
            cancelButtonText: "放弃修改",
            type: "warning",
            center: true,
          }
        )
          .then(() => {
            // this.$router.go(-1)
            // this.DialogVisible = true
            // const state3 = localStorage.getItem("state3");
            // console.log(state3);
            // this.$message({
            //   type: "success",
            //   message: "暂存成功！",
            // });
            this.BackStorage();
            if (this.$route.path !== "/home") {
              this.$router.push({ path: "/home" });
            }
            // this.$router.push("/home");
            return false;
          })
          .catch(() => {
            // const state3 = sessionStorage.getItem('state3')
            // console.log(state3)
            this.$message({
              type: "info",
              message: "已取消暂存！",
            });
            if (this.$route.path !== "/home") {
              this.$router.push({ path: "/home" });
            }
            // this.giveUp()
            return false;
          });
      } else {
        this.$router.push({ path: "/home" });
      }
    },
    // 控制暂存弹窗出现
    storage() {
      this.DialogVisible = true;
    },
    // 暂存弹窗里面的确定按钮，实现暂存
    storageOk() {
      const b1 = sessionStorage.getItem("b1");
      this.form2.b1 = b1;
      const b2 = sessionStorage.getItem("b2");
      this.form2.b2 = b2;
      const b3 = sessionStorage.getItem("b3");
      this.form2.b3 = b3;
      const b4 = sessionStorage.getItem("b4");
      this.form2.b4 = b4;
      const b5 = sessionStorage.getItem("b5");
      this.form2.b5 = b5;
      const b6 = sessionStorage.getItem("b6");
      this.form2.b6 = b6;
      const b7 = sessionStorage.getItem("b7");
      this.form2.b7 = b7;

      const c1 = sessionStorage.getItem("c1");
      this.form2.c1 = c1;
      const c2 = sessionStorage.getItem("c2");
      this.form2.c2 = c2;
      const c3 = sessionStorage.getItem("c3");
      this.form2.c3 = c3;
      const c4 = sessionStorage.getItem("c4");
      this.form2.c4 = c4;
      const c5 = sessionStorage.getItem("c5");
      this.form2.c5 = c5;
      const c6 = sessionStorage.getItem("c6");
      this.form2.c6 = c6;
      const c7 = sessionStorage.getItem("c7");
      this.form2.c7 = c7;
      const c8 = sessionStorage.getItem("c8");
      this.form2.c8 = c8;
      const c9 = sessionStorage.getItem("c9");
      this.form2.c9 = c9;
      const c10 = sessionStorage.getItem("c10");
      this.form2.c10 = c10;
      const c11 = sessionStorage.getItem("c11");
      this.form2.c11 = c11;
      const c12 = sessionStorage.getItem("c12");
      this.form2.c12 = c12;

      const d1 = sessionStorage.getItem("d1");
      this.form2.d1 = d1;
      const d2 = sessionStorage.getItem("d2");
      this.form2.d2 = d2;
      const d3 = sessionStorage.getItem("d3");
      this.form2.d3 = d3;
      const d4 = sessionStorage.getItem("d4");
      this.form2.d4 = d4;
      const d5 = sessionStorage.getItem("d5");
      this.form2.d5 = d5;
      const d6 = sessionStorage.getItem("d6");
      this.form2.d6 = d6;


      window.localStorage.setItem("b1", this.form2.b1);
      window.localStorage.setItem("b2", this.form2.b2);
      window.localStorage.setItem("b3", this.form2.b3);
      window.localStorage.setItem("b4", this.form2.b4);
      window.localStorage.setItem("b5", this.form2.b5);
      window.localStorage.setItem("b6", this.form2.b6);
      window.localStorage.setItem("b7", this.form2.b7);
      window.localStorage.setItem("c1", this.form2.c1);
      window.localStorage.setItem("c2", this.form2.c2);
      window.localStorage.setItem("c3", this.form2.c3);
      window.localStorage.setItem("c4", this.form2.c4);
      window.localStorage.setItem("c5", this.form2.c5);
      window.localStorage.setItem("c6", this.form2.c6);
      window.localStorage.setItem("c7", this.form2.c7);
      window.localStorage.setItem("c8", this.form2.c8);
      window.localStorage.setItem("c9", this.form2.c9);
      window.localStorage.setItem("c10", this.form2.c10);
      window.localStorage.setItem("c11", this.form2.c11);
      window.localStorage.setItem("c12", this.form2.c12);
      window.localStorage.setItem("d1", this.form2.d1);
      window.localStorage.setItem("d2", this.form2.d2);
      window.localStorage.setItem("d3", this.form2.d3);
      window.localStorage.setItem("d4", this.form2.d4);
      window.localStorage.setItem("d5", this.form2.d5);
      window.localStorage.setItem("d6", this.form2.d6);
      window.localStorage.setItem("e1", this.form2.e1);
      window.localStorage.setItem("e2", this.form2.e2);
      window.localStorage.setItem("e3", this.form2.e3);
      window.localStorage.setItem("e4", this.form2.e4);
      window.localStorage.setItem("f1", this.form2.f1);
      window.localStorage.setItem("f2", this.form2.f2);
      window.localStorage.setItem("f3", this.form2.f3);
      window.localStorage.setItem("g3", this.form2.g3);
      window.localStorage.setItem("g2", this.form2.g2);
      window.localStorage.setItem("g1", this.form2.g1);
      window.localStorage.setItem("x1", this.form2.x1);
      window.localStorage.setItem("x2", this.form2.x2);
      window.localStorage.setItem("x3", this.form2.x3);
      this.$message({
        message: "暂存成功！",
        type: "success",
      });
      localStorage.setItem("state3", 2);
    },
    // 存储按下浏览器返回键的暂存数据
    BackStorage() {
      const b1 = sessionStorage.getItem("b1");
      this.form2.b1 = b1;
      const b2 = sessionStorage.getItem("b2");
      this.form2.b2 = b2;
      const b3 = sessionStorage.getItem("b3");
      this.form2.b3 = b3;
      const b4 = sessionStorage.getItem("b4");
      this.form2.b4 = b4;
      const b5 = sessionStorage.getItem("b5");
      this.form2.b5 = b5;
      const b6 = sessionStorage.getItem("b6");
      this.form2.b6 = b6;
      const b7 = sessionStorage.getItem("b7");
      this.form2.b7 = b7;

      const c1 = sessionStorage.getItem("c1");
      this.form2.c1 = c1;
      const c2 = sessionStorage.getItem("c2");
      this.form2.c2 = c2;
      const c3 = sessionStorage.getItem("c3");
      this.form2.c3 = c3;
      const c4 = sessionStorage.getItem("c4");
      this.form2.c4 = c4;
      const c5 = sessionStorage.getItem("c5");
      this.form2.c5 = c5;
      const c6 = sessionStorage.getItem("c6");
      this.form2.c6 = c6;
      const c7 = sessionStorage.getItem("c7");
      this.form2.c7 = c7;
      const c8 = sessionStorage.getItem("c8");
      this.form2.c8 = c8;
      const c9 = sessionStorage.getItem("c9");
      this.form2.c9 = c9;
      const c10 = sessionStorage.getItem("c10");
      this.form2.c10 = c10;
      const c11 = sessionStorage.getItem("c11");
      this.form2.c11 = c11;
      const c12 = sessionStorage.getItem("c12");
      this.form2.c12 = c12;

      const d1 = sessionStorage.getItem("d1");
      this.form2.d1 = d1;
      const d2 = sessionStorage.getItem("d2");
      this.form2.d2 = d2;
      const d3 = sessionStorage.getItem("d3");
      this.form2.d3 = d3;
      const d4 = sessionStorage.getItem("d4");
      this.form2.d4 = d4;
      const d5 = sessionStorage.getItem("d5");
      this.form2.d5 = d5;
      const d6 = sessionStorage.getItem("d6");
      this.form2.d6 = d6;

      window.localStorage.setItem("b1", this.form2.b1);
      window.localStorage.setItem("b2", this.form2.b2);
      window.localStorage.setItem("b3", this.form2.b3);
      window.localStorage.setItem("b4", this.form2.b4);
      window.localStorage.setItem("b5", this.form2.b5);
      window.localStorage.setItem("b6", this.form2.b6);
      window.localStorage.setItem("b7", this.form2.b7);
      window.localStorage.setItem("c1", this.form2.c1);
      window.localStorage.setItem("c2", this.form2.c2);
      window.localStorage.setItem("c3", this.form2.c3);
      window.localStorage.setItem("c4", this.form2.c4);
      window.localStorage.setItem("c5", this.form2.c5);
      window.localStorage.setItem("c6", this.form2.c6);
      window.localStorage.setItem("c7", this.form2.c7);
      window.localStorage.setItem("c8", this.form2.c8);
      window.localStorage.setItem("c9", this.form2.c9);
      window.localStorage.setItem("c10", this.form2.c10);
      window.localStorage.setItem("c11", this.form2.c11);
      window.localStorage.setItem("c12", this.form2.c12);
      window.localStorage.setItem("d1", this.form2.d1);
      window.localStorage.setItem("d2", this.form2.d2);
      window.localStorage.setItem("d3", this.form2.d3);
      window.localStorage.setItem("d4", this.form2.d4);
      window.localStorage.setItem("d5", this.form2.d5);
      window.localStorage.setItem("d6", this.form2.d6);
      window.localStorage.setItem("e1", this.form2.e1);
      window.localStorage.setItem("e2", this.form2.e2);
      window.localStorage.setItem("e3", this.form2.e3);
      window.localStorage.setItem("e4", this.form2.e4);
      window.localStorage.setItem("f1", this.form2.f1);
      window.localStorage.setItem("f2", this.form2.f2);
      window.localStorage.setItem("f3", this.form2.f3);
      window.localStorage.setItem("g3", this.form2.g3);
      window.localStorage.setItem("g2", this.form2.g2);
      window.localStorage.setItem("g1", this.form2.g1);
      window.localStorage.setItem("x1", this.form2.x1);
      window.localStorage.setItem("x2", this.form2.x2);
      window.localStorage.setItem("x3", this.form2.x3);
      this.$message({
        message: "暂存成功！",
        type: "success",
      });
      // localStorage.setItem("state3", 2);
    },
    // 一进入页面就获取到获取暂存里面的数据,并且将数据赋值
    storageCheck() {
      const b1 = window.localStorage.getItem("b1", this.form2.b1);
      this.form2.b1 = b1;
      const b2 = window.localStorage.getItem("b2", this.form2.b2);
      this.form2.b2 = b2;
      const b3 = window.localStorage.getItem("b3", this.form2.b3);
      this.form2.b3 = b3;
      const b4 = window.localStorage.getItem("b4", this.form2.b4);
      this.form2.b4 = b4;
      const b5 = window.localStorage.getItem("b5", this.form2.b5);
      this.form2.b5 = b5;
      const b6 = window.localStorage.getItem("b6", this.form2.b6);
      this.form2.b6 = b6;
      const b7 = window.localStorage.getItem("b7", this.form2.b7);
      this.form2.b7 = b7;
      const c1 = window.localStorage.getItem("c1", this.form2.c1);
      this.form2.c1 = c1;
      const c2 = window.localStorage.getItem("c2", this.form2.c2);
      this.form2.c2 = c2;
      const c3 = window.localStorage.getItem("c3", this.form2.c3);
      this.form2.c3 = c3;
      const c4 = window.localStorage.getItem("c4", this.form2.c4);
      this.form2.c4 = c4;
      const c5 = window.localStorage.getItem("c5", this.form2.c5);
      this.form2.c5 = c5;
      const c6 = window.localStorage.getItem("c6", this.form2.c6);
      this.form2.c6 = c6;
      const c7 = window.localStorage.getItem("c7", this.form2.c7);
      this.form2.c7 = c7;
      const c8 = window.localStorage.getItem("c8", this.form2.c8);
      this.form2.c8 = c8;
      const c9 = window.localStorage.getItem("c9", this.form2.c9);
      this.form2.c9 = c9;
      const c10 = window.localStorage.getItem("c10", this.form2.c10);
      this.form2.c10 = c10;
      const c11 = window.localStorage.getItem("c11", this.form2.c11);
      this.form2.c11 = c11;
      const c12 = window.localStorage.getItem("c12", this.form2.c12);
      this.form2.c12 = c12;
      const d1 = window.localStorage.getItem("d1", this.form2.d1);
      this.form2.d1 = d1;
      const d2 = window.localStorage.getItem("d2", this.form2.d2);
      this.form2.d2 = d2;
      const d3 = window.localStorage.getItem("d3", this.form2.d3);
      this.form2.d3 = d3;
      const d4 = window.localStorage.getItem("d4", this.form2.d4);
      this.form2.d4 = d4;
      const d5 = window.localStorage.getItem("d5", this.form2.d5);
      this.form2.d5 = d5;
      const d6 = window.localStorage.getItem("d6", this.form2.d6);
      this.form2.d6 = d6;
      const e1 = window.localStorage.getItem("e1", this.form2.e1);
      this.form2.e1 = e1;
      const e2 = window.localStorage.getItem("e2", this.form2.e2);
      this.form2.e2 = e2;
      const e3 = window.localStorage.getItem("e3", this.form2.e3);
      this.form2.e3 = e3;
      const e4 = window.localStorage.getItem("e4", this.form2.e4);
      this.form2.e4 = e4;
      const f1 = window.localStorage.getItem("f1", this.form2.f1);
      this.form2.f1 = f1;
      const f2 = window.localStorage.getItem("f2", this.form2.f2);
      this.form2.f2 = f2;
      const f3 = window.localStorage.getItem("f3", this.form2.f3);
      this.form2.f3 = f3;
      const g3 = window.localStorage.getItem("g3", this.form2.g3);
      this.form2.g3 = g3;
      const g2 = window.localStorage.getItem("g2", this.form2.g2);
      this.form2.g2 = g2;
      const g1 = window.localStorage.getItem("g1", this.form2.g1);
      this.form2.g1 = g1;
      const x1 = window.localStorage.getItem("x1", this.form2.x1);
      this.form2.x1 = x1;
      const x2 = window.localStorage.getItem("x2", this.form2.x2);
      this.form2.x2 = x2;
      const x3 = window.localStorage.getItem("x3", this.form2.x3);
      this.form2.x3 = x3;
      // for (var key in this.form2) {
      //   console.log(this.form2[key]);
      //   if (this.form2[key] == "null") {
      //     this.form2[key] = "";
      //     // return false;
      //   }
      // }
    },
  },
};
</script>
<style scoped>
.test {
  height: 100%;
  width: 50%;
  min-width: 320px;
  margin: 0 auto;
  /* display: flex;
  justify-content: center;
  align-items: center; */
}
.count4 {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.dui {
  margin-bottom: 0;
}
p {
  line-height: 25px;
  /* .zhuzhu .el-table{
  height: 30%;
} */
}
.btn {
  /* width: 20%;
  margin-left: 40%;
  margin-bottom: 2vw; */
  left: 0%;
  margin-bottom: 5%;
  bottom: 0%;
  width: 20%;
  transform: translate(120%, 30%);
}
.el-table p {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.shiboSettingsThreestyle {
  text-align: center;
  /* .img{
    width: 120px;
    height: 120px;
} */
}
</style>
